package pl.edu.utp.kursy.database;

import java.util.Set;
import javax.persistence.*;

@Entity
@Table(name = "courses")
public class Course extends BaseCourse{
    
    @Column(name = "cost")
    private double cost = 0.0;
    
    @ManyToOne(fetch = FetchType.EAGER)
    private CourseCategory category;
    
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "course",cascade = CascadeType.REMOVE)
    private Set<CourseEvent> courseEvents;
    
    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }
    
    public CourseCategory getCategory() {
        return category;
    }

    public void setCategory(CourseCategory category) {
        this.category = category;
    }

    public Set<CourseEvent> getCourseEvents() {
        return courseEvents;
    }

    public void setCourseEvents(Set<CourseEvent> courseEvent) {
        this.courseEvents = courseEvent;
    }
}
